<?php
(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) && exit('Access Denied');
loadcache('plugin');
require_once (DISCUZ_ROOT.'./source/plugin/touclick/func/touclick_request.func.php');
require_once (DISCUZ_ROOT.'./source/plugin/touclick/func/touclick_tools.func.php');
require_once (DISCUZ_ROOT.'./source/plugin/touclick/include/JSON.php');

$tcJSON = new CJSON();

if(file_exists(DISCUZ_ROOT.'./data/plugindata/touclick.lang.php')){
	include DISCUZ_ROOT.'./data/plugindata/touclick.lang.php';
} else {
	loadcache('pluginlanguage_script');
}
$scriptlang['touclick'] = $_G['cache']['pluginlanguage_script']['touclick'];
$touclicklang = $scriptlang['touclick'];

$touclickB = trim($_G['cache']['plugin']['touclick']['sitekey']);
$touclickZ = trim($_G['cache']['plugin']['touclick']['identity']);
$touclickV = "v2-1-2";
$touclickPF = "discuz";
$touclickD =urlencode($_G['siteurl']);
$touclickCS = $_G['config']['output']['charset'];

$identifier = $_GET['identifier'];
$urls = '&pmod=monitor&identifier='.$identifier.'&operation='.$operation.'&do='.$do;

showsubmenus('<font color="#FF6600">'.$touclicklang['tcmsg0001'].'</font>',array(
array(array('menu' => $touclicklang['tcmsg0002'], 'submenu' => array(
		array($touclicklang['tcmsg0002'], 'plugins&cp=monitorip'.$urls),
))),

array(array('menu' => $touclicklang['tcmsg0003'], 'submenu' => array(
		array($touclicklang['tcmsg0003'], 'plugins&cp=monitorcontent'.$urls),
))),

));

$cparray = array('monitorip', 'monitorcontent');
$cp = !in_array($_GET['cp'], $cparray) ? 'monitorip' : $_GET['cp'];

if($touclickB == "" || $touclickZ == "" ){
	cpmsg($touclicklang['tcmsg0020'], "", 'error');
}
if($touclickB == $touclickZ || strlen($touclickB) != 36 || strlen($touclickZ) != 36){
	cpmsg($touclicklang['tcmsg0021'], "", 'error');
}

require (DISCUZ_ROOT.'./source/plugin/touclick/include/touclick_'.$cp.'.inc.php');

?>
<script type="text/JavaScript">
function altStyleTc(obj, disabled) {
	function altStyleClear(obj) {
		var input,
		lis,
		i;
		lis = obj.parentNode.getElementsByTagName('li');
		for (i = 0; i < lis.length; i++) {
			lis[i].className = '';
		}
	}
	var disabled = !disabled ? 0: disabled;
	if (disabled) {
		return;
	}
	var input,
	lis,
	i,
	cc,
	o;
	cc = 0;
	lis = obj.getElementsByTagName('li');
	var flag=0;
	for (i = 0; i < lis.length; i++) {
		lis[i].onclick = function(e) {
			o = BROWSER.ie ? event.srcElement.tagName: e.target.tagName;
			altKey = BROWSER.ie ? window.event.altKey: e.altKey;
			if (cc) {
				return;
			}
			cc = 1;
			input = this.getElementsByTagName('input')[0];
			if (input.getAttribute('type') == 'checkbox' || input.getAttribute('type') == 'radio') {
				if (input.getAttribute('type') == 'radio') {
					altStyleClear(this);
				}
				if (BROWSER.ie || o != 'INPUT' && input.onclick) {
					input.click();
				}
				if (this.className != 'checked') {
					this.className = 'checked';
					input.checked = true;
				} else {
					this.className = '';
					input.checked = false;
				}
				if (altKey && input.name.match(/^multinew\[\d+\]/)) {
					miid = input.id.split('|');
					mi = 0;
					while ($(miid[0] + '|' + mi)) {
						$(miid[0] + '|' + mi).checked = input.checked;
						if (input.getAttribute('type') == 'radio') {
							altStyleClear($(miid[0] + '|' + mi).parentNode);
						}
						$(miid[0] + '|' + mi).parentNode.className = input.checked ? 'checked': '';
						mi++;
					}
				}

			}
		};

		lis[i].onmouseup = function(e) {
			cc = 0;
				
		}
	}
}
</script>